home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 98 / Skunkware 98.iso / src / mail / pine3.96.tar.gz / pine3.96.tar / pine3.96 / pine / brk2pine.sh < prev    next >
Linux/UNIX/POSIX Shell Script  |  1996-03-15  |  2KB  |  68 lines

  1. #!/bin/sh
  2. #
  3. # $Id: brk2pine.sh,v 4.4 1996/03/15 07:13:42 hubert Exp $
  4. #
  5. #            T H E    P I N E    M A I L   S Y S T E M
  6. #
  7. #   Laurence Lundblade and Mike Seibel
  8. #   Networks and Distributed Computing
  9. #   Computing and Communications
  10. #   University of Washington
  11. #   Administration Building, AG-44
  12. #   Seattle, Washington, 98195, USA
  13. #   Internet: lgl@CAC.Washington.EDU
  14. #             mikes@CAC.Washington.EDU
  15. #
  16. #   Please address all bugs and comments to "pine-bugs@cac.washington.edu"
  17. #
  18. #
  19. #   Pine and Pico are registered trademarks of the University of Washington.
  20. #   No commercial use of these trademarks may be made without prior written
  21. #   permission of the University of Washington.
  22. #
  23. #   Pine, Pico, and Pilot software and its included text are Copyright
  24. #   1989-1996 by the University of Washington.
  25. #
  26. #   The full text of our legal notices is contained in the file called
  27. #   CPYRIGHT, included with this distribution.
  28. #
  29. #
  30. #   Pine is in part based on The Elm Mail System:
  31. #    ***********************************************************************
  32. #    *  The Elm Mail System  -  Revision: 2.13                             *
  33. #    *                                                                     *
  34. #    *             Copyright (c) 1986, 1987 Dave Taylor               *
  35. #    *             Copyright (c) 1988, 1989 USENET Community Trust    *
  36. #    ***********************************************************************
  37. #
  38.  
  39.  
  40. #
  41. # A filter to convert personal mail aliases in a .mailrc file into
  42. # pine address book format.
  43. #
  44. # Usage: program [.mailrc] >> .addressbook
  45. #
  46. # Corey Satten, corey@cac.washington.edu, 9/25/91
  47. #
  48. sed -n '
  49. # first fold continued lines (ending in \) into a single long line
  50.     /\\[     ]*$/ {
  51.         : more
  52.         s/\\//g
  53.         N
  54.         s/\n/ /
  55.         /\\/b more
  56.         }
  57. # next convert all sequences of whitespace into single space
  58.     s/[     ][     ]*/ /g
  59. # finally, reformat and print lines containing alias as the first word
  60.     /^ *alias / {
  61.         s/^ *alias \([!-~][!-~]*\) \(.*\)$/\1    \1    (\2)/
  62.         s/ /,/g
  63.         s/(\([^,]*\))/\1/
  64.         p
  65.         }
  66. ' ${*-$HOME/.mailrc}
  67.